package mkis.service.root.data.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

import mkis.service.root.data.model.QuestionsDt;
import mkis.service.root.data.model.TeamTouch;
import mkis.service.root.data.model.TeamTouchDetail;
import mkis.service.root.data.model.TeamtouchCust;
import mkis.service.root.data.model.TeamtouchIdea;

@Repository("teamTouchDAO")
public class TeamTouchDAO {

	@Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;
	
	public List<TeamTouch> getTeamTouchList(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.queryForList("teamTouch.getTeamTouchList",paramMap);
	}

	public List<TeamTouch> getTeamTouchView(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.queryForList("teamTouch.getTeamTouchView",paramMap);
	}

	public TeamTouchDetail getTeamTouchDetail(Map<String, Object> paramMap) throws Exception {
		return (TeamTouchDetail) sqlMapClient.queryForObject("teamTouch.getTeamTouchDetail",paramMap);
	}

	public int getTeamTouchViewCount(Map<String, Object> paramMap) throws Exception {
		return (Integer) sqlMapClient.queryForObject("teamTouch.getTeamTouchViewCount",paramMap);
	}

	public int getTeamTouchCount(Map<String, Object> paramMap) throws Exception {
		return (Integer) sqlMapClient.queryForObject("teamTouch.getTeamTouchCount",paramMap);
	}

	public int insertTeamtTouchData(Map<String, Object> paramData) throws Exception {
		sqlMapClient.insert("teamTouch.insertTeamtTouchData", paramData);
		return 1; 
	}
	
	public int deleteTeamtTouchData(Map<String, Object> paramData) throws Exception {
		return sqlMapClient.delete("teamTouch.deleteTeamtTouchData", paramData);
	}

	public int updateTeamTouchScore(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.update("teamTouch.updateTeamTouchScore", paramMap);
	}

	public int insertTeamTouchDetail(Map<String, Object> paramMap) throws Exception {
		sqlMapClient.insert("teamTouch.insertTeamTouchDetail", paramMap);
		return 1;
		
	}

	public int getAnswerChk(Map<String, Object> paramMap) throws Exception {
		return (Integer) sqlMapClient.queryForObject("teamTouch.getAnswerChk",paramMap);
	}

	public int updateTeamTouchDetail(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.update("teamTouch.updateTeamTouchDetail", paramMap);
	}

	public int getTeamTouchViewDtCount(Map<String, Object> paramMap) throws Exception {
		return (Integer) sqlMapClient.queryForObject("teamTouch.getTeamTouchViewDtCount",paramMap);
	}

	public List<TeamtouchCust> getContactCustList(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.queryForList("teamTouch.getContactCustList",paramMap);
	}

	public List<QuestionsDt> getQuestionsList(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.queryForList("teamTouch.getQuestionsList",paramMap);
	}

	public List<TeamtouchIdea> getIdeaList(Map<String, Object> paramMap) throws Exception {
		return sqlMapClient.queryForList("teamTouch.getIdeaList",paramMap);
	}
	
	
	public int insertTeamtTouchCustData(Map<String, Object> paramData)  throws Exception {
		sqlMapClient.insert("teamTouch.insertTeamtTouchCustData", paramData);
		return 1;
	}

	public int insertTeamtTouchIdeaData(Map<String, Object> paramData) throws Exception  {
		sqlMapClient.insert("teamTouch.insertTeamtTouchIdeaData", paramData);
		return 1;
	}

	public int deleteTeamtTouchIdeaData(Map<String, Object> paramData) throws Exception {
		return sqlMapClient.delete("teamTouch.deleteTeamtTouchIdeaData", paramData);
	}

	public int deleteTeamtTouchCustData(Map<String, Object> paramData) throws Exception {
		return sqlMapClient.delete("teamTouch.deleteTeamtTouchCustData", paramData);
	}

	public int insertTeamtTouchEmpData(Map<String, Object> paramData) throws Exception  {
		sqlMapClient.insert("teamTouch.insertTeamtTouchEmpData", paramData);
		return 1;
	}

	public int deleteTeamtTouchEmpData(Map<String, Object> paramData) throws Exception {
		return sqlMapClient.delete("teamTouch.deleteTeamtTouchEmpData", paramData);
	}
}
